import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home', //首页
    name: 'Index',
    component: () => import('@/views/index'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/join', //加盟咨询代理
    name: 'join',
    component: () => import('@/views/join'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/consult', //咨詢
    name: 'consult',
    component: () => import('@/views/consult'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/consultDetail/:id', //咨詢详情
    name: 'consultDetail',
    component: () => import('@/views/consultDetail'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/merchants', //招商
    name: 'merchants',
    component: () => import('@/views/merchants'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/agency', // 我的
    name: 'agency',
    component: () => import('@/views/agency'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/loans', //贷款金额
    name: 'loans',
    component: () => import('@/views/loans'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/widthdrawral', //提现金额
    name: 'widthdrawral',
    component: () => import('@/views/widthdrawral'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/recharge', // 充值中心
    name: 'recharge',
    component: () => import('@/views/recharge'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/evidence', // 充值凭证
    name: 'evidence',
    component: () => import('@/views/evidence'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/deposit', // 提现中心
    name: 'deposit',
    component: () => import('@/views/deposit'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/apply', // 提现成功
    name: 'apply',
    component: () => import('@/views/apply'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/video/:id', //视频详情页
    name: 'video',
    component: () => import('@/views/video')
  },
  {
    path: '/product/:id', //产品详情页
    name: 'product',
    component: () => import('@/views/product')
  },
  {
    path: '/allevaluate/:id', //所有好评
    name: 'allevaluate',
    component: () => import('@/views/product/allevaluate')
  },
  {
    path: '/interests', // 代理商权益
    name: 'interests',
    component: () => import('@/views/interests')
  },
  {
    path: '/myCloud', //我的云仓
    name: 'myCloud',
    component: () => import('@/views/myCloud')
  },
  {
    path: '/deliveryConfirmat', //我的云仓---提货
    name: 'deliveryConfirmat',
    component: () => import('@/views/myCloud/deliveryConfirmat')
  },
  {
    path: '/deliverySuccess', //我的云仓---提货---支付成功页面
    name: 'deliverySuccess',
    component: () => import('@/views/myCloud/deliverySuccess')
  },
  {
    path: '/orderForm', //我的云仓---提货---支付成功页面----订单页面
    name: 'orderForm',
    component: () => import('@/views/orderForm')
  },
  {
    path: '/address', //我的云仓---提货---收货地址---
    name: 'address',
    component: () => import('@/views/address')
  },
  {
    path: '/addNewAddress', //我的云仓---提货---收货地址---添加收货地址---
    name: 'addNewAddress',
    component: () => import('@/views/address/addNewAddress')
  },
  {
    path: '/replenish', //个人中心---补货
    name: 'replenish',
    component: () => import('@/views/replenish')
  },
  {
    path: '/replenishRecord', //个人中心---补货记录
    name: 'replenishRecord',
    component: () => import('@/views/replenish/replenishRecord')
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
